package dao

import (
	"gorm.io/gorm"
	"partyus_app/models"
)

func GetSQLPostList(pageNum, pageSize int, query *gorm.DB, posts *[]models.Post) error {
	err := query.Offset((pageNum - 1) * pageSize).Preload("User").Select("id,user_id,type,title,cover,video,part,is_audit,created_at,SUBSTR(content, 1, 100) as content").Limit(pageSize).Find(&posts).Error
	return err
}
